Computer programs are implemented in countless ways in modern life to provide control, monitoring and other capabilities to a variety of systems. Although some standardized programs are used ubiquitously, many (if not most) modern systems require at least some programming that is uniquely tailored for the particular purposes of the systems. For example, industrial controllers, which are commonly used for controlling industrial processes or manufacturing equipment, typically require control programs that are uniquely designed for the particular industrial process. Accordingly, it is important to be able to efficiently and easily develop such programs. In this regard, it is known to reuse elemental portions of other control program “fragments” or “templates” in creating the control logic of a control program for a particular job. This may be done by copying the program templates and instantiating them one or more times within the body of the control program to be developed.
A characteristic feature of many control programs is the use of a large number of input and output variables, each corresponding to control points on the controlled process. The input and output variables of the reused program templates, when integrated into the body of the control program being developed, must be re-named and cross referenced so as to preserve the uniqueness of the variable names for each template and so as to keep track of the variable's relationship both to the overall controlled process and to the program template of which it is a part. This renaming and cross-referencing is a laborious task.
In U.S. patent application Ser. No. 09/404,771, which was filed on Sep. 24, 1999, and which is hereby incorporated by reference herein, a system is described that allows templates to be associated with portions of a model of an industrial process (an “area-model”), typically in response to commands received from a program designer as provided by way of a computer terminal. Once the templates are associated with portions of the area-model, the templates are instantiated into objects that pertain to the particular portions/components. During the instantiation process, the system automatically renames those of the variables of the instantiated objects that must be renamed in order to allow the objects to operate in concert with one another as an overall control program.
Although the above-described system works well in many circumstances, there are occasions where the system's efficiency of operation could be improved. In particular, there are occasions where the templates that are available to a program designer pertain to relatively low-level components of a process (e.g., a motor in an industrial process), even though higher-level components of the process (e.g., a conveyor employing multiple motors) may sometimes be employed. On such occasions, the above-described system is only able to properly rename the variables of the templates at the lowest level. If, at a higher-level, one of the templates depends upon one of the lower-level templates, the program designer must manually rename the relevant variables.
For example, a template having two rungs of ladder logic with four control variables can be used to control the operation of a motor that raises and lowers a conveyor table. One rung of the ladder logic can (in this example) provide that the motor would raise the conveyor table so long as an up pushbutton was pressed (represented by a variable named UP_PB), and so long as an upper limit of the conveyor table's position was not reached (represented by a variable named UP_LIMIT). A second rung of the ladder logic could provide that the motor would lower the conveyor table so long as a down pushbutton was pressed (represented by a variable DOWN_PB), and so long as a lower limit of the conveyor table's position was not reached (represented by a variable named DOWN_LIMIT). Given this example, the above-described system for developing a control program could properly instantiate the template. During instantiation, the variables each could be provided with a prefix (e.g., MOTOR1_) indicating that the variables pertained to the first motor, thus producing the desired control program (or at least the desired portion of a control program) for controlling the motor.
However, suppose that this control program was being designed not only to control the motor for raising and lowering the conveyor table, but also to control a second motor for the conveyor itself. In such case, the second motor for the conveyor could be controlled according to a third rung of ladder logic in which that motor would run so long as a run pushbutton was pressed (represented by a variable RUN_PB), so long as both the up limit of the conveyor table (represented by a variable UP) was attained and the down limit of the conveyor table (represented by a variable DOWN) was not attained. Further, during instantiation, each of these variables could be provided with another prefix (e.g., MOTOR 2_) indicating that these variables pertained to a second motor.
While instantiation of these variables relating to the second motor would produce a desired control program (or control program portion) if only the second motor's operation was of interest, in this example, the second motor's operation in fact is interrelated to the operation of the first motor—that is, the variables UP and DOWN correspond to the variables UP_LIMIT and DOWN_LIMIT associated with the first motor. Consequently, the desired control program for the overall conveyor should, upon instantiation, utilize the same variables to represent the position of the conveyor table in all three rungs of ladder logic, rather than different variables in the different rungs of ladder logic (e.g., MOTOR1_UP_LIMIT and MOTOR1_DOWN_LIMIT versus MOTOR2_UP and MOTOR2−DOWN).
Of course, the different variable names can be manually changed by the program designer after the instantiation process has occurred. However, such manual changes are what the programming system is intended to minimize. Also, a higher-level, specialized template for a conveyor could be designed, without involving the specific templates for the first and second motors. Yet the creation of such a specialized template would in itself be complicated. Further, the creation of such a specialized template would eliminate the benefits associated with creating control programs by way of lower-level, simpler, more modular templates such as those representing the motors.
Therefore, it would be advantageous if an improved method and system for developing control programs could be designed. In particular, it would be advantageous if such a method and system allowed for developing a control program by selecting low-level, modular templates and instantiating corresponding objects based upon those templates, but also facilitated the appropriate renaming of control variables during the instantiation process even when the various modular templates referred to one another or otherwise built upon one another to create higher-level program portions representing higher-level system components.